<template>
       <div>
           <el-form :inline="true" :model="AdmSigninreco" class="demo-form-inline">
               <el-form-item label="签到人：">
                   <el-input v-model="AdmSigninreco.uname" placeholder="签到人"></el-input>
               </el-form-item>
               <el-form-item label="时间：">

                   <el-col :span="11">
                       <el-input type="date" placeholder="选择日期" v-model="AdmSigninreco.signinrecordSign"></el-input>
                   </el-col>
                   <el-col class="line" :span="2">-</el-col>
                   <el-col :span="11">
                       <el-input type="date" placeholder="选择日期" v-model="AdmSigninreco.signinrecordSite"></el-input>
                   </el-col>
               </el-form-item>
               <el-form-item>
                   <el-select placeholder="请选择" v-model="AdmSigninreco.classify">
                       <el-option label="==全部==" value="0"></el-option>
                       <el-option label="上班签到" value="1"></el-option>
                       <el-option label="会议签到" value="2"></el-option>
                       <el-option label="外勤签到" value="3"></el-option>
                   </el-select>
               </el-form-item>
               <el-form-item>
                   <el-button type="primary" @click="GetAdmSigninrecos">查询</el-button>
               </el-form-item>
           </el-form>
           <el-table :data="AdmSigninrecos.slice((currentPage-1)*pagesize,currentPage*pagesize)" height="500" border style="width: 100%">
               <el-table-column label="签到人" prop="uname"></el-table-column>
               <el-table-column label="签到地点" prop="signinrecordSite"></el-table-column>
               <el-table-column label="签到类型" prop="classify">
                   <template scope="scope">
                       <p v-if="scope.row.classify==1">上班签到</p >
                       <p v-if="scope.row.classify==2">会议签到</p >
                       <p v-if="scope.row.classify==3">外勤签到</p >
                   </template>
               </el-table-column>
               <el-table-column label="签到日期" prop="signinrecordSign"></el-table-column>
               <el-table-column  label="签到类型">
                   <template scope="scope">
                       <p v-if="scope.row.signinStatus=='D'">签到</p >
                       <p v-if="scope.row.signinStatus=='T'">签退</p >

                   </template>
               </el-table-column>
           </el-table>
           <el-pagination
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange"
                   :current-page="currentPage"
                   :page-sizes="[5, 10, 20, 40]"
                   :page-size="pagesize"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="AdmSigninrecos.length">
           </el-pagination>
       </div>
</template>

<script>
    import sdmsigninreco from "../../../model/gsl/AdmSigninreco/AdmSigninreco";
    const sd=sdmsigninreco.getInstance();
    export default{
        components:{},
        data() {
            return {
                currentPage:1, //初始页
                pagesize:10,    //    每页的数
                AdmSigninrecos:[],
                AdmSigninreco:{}
            };
        },
        created(){
            this.GetAdmSigninrecos();

            },
        methods: {
        // 初始页currentPage、初始每页数据数pagesize和数据data
        handleSizeChange: function (size) {
            this.pagesize = size;
            console.log(this.pagesize)  //每页下拉显示数据
        },
        handleCurrentChange: function(currentPage){
            this.currentPage = currentPage;
            console.log(this.currentPage)  //点击第几页
        },
            GetAdmSigninrecos(){
                sd.list(this.AdmSigninreco).then((re)=>{
                    this.AdmSigninrecos=re.data.data;
                    this.AdmSigninreco={}
                })
            }
        }
    }
</script>
